import './assets/main.css'

import { createApp } from 'vue'
import App from './App.vue'
//router
import router from './router/index'
//pinia
import { createPinia } from 'pinia'
import { useToolsStore } from '@/store/tools.ts'
//element-plus
import { setupElementUIPlus } from './plugins/element-ui-plus'
//v-md-editor
import { setupMdEditor } from './plugins/v-md-editor'
//自定义组件
import ToolHeader from '@/components/tools/ToolHeader.vue'
import ToolDetail from '@/components/tools/ToolDetail.vue'
//font-awesome图标
import { library } from '@fortawesome/fontawesome-svg-core'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import { far } from '@fortawesome/free-regular-svg-icons'

library.add(far)
const pinia = createPinia()
const app = createApp(App)
//配置路由
app.use(router)

//安装仓库
app.use(pinia)
//tools store
useToolsStore().init()
//element-plus
setupElementUIPlus(app)
//md-editor插件
setupMdEditor(app)
//注册全局组件
app.component("ToolHeader", ToolHeader)
app.component("ToolDetail", ToolDetail)
app.component('font-awesome-icon', FontAwesomeIcon)

app.mount('#app')
